//导入fs模块.
const fs = require("fs");
fs.writeFile(__dirname + "/test.txt",'hello world!!!!' ,function(err){
    console.log(__dirname);
    if(err){
       return console.log("文件写入失败" + err.message);
    }
    else{
        return console.log("文件写入成功！");
    }
})